/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.net.greenet.logmanage.logic.bean;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 *
 * @author dongqiang
 */
@DatabaseTable(tableName="DPIEndPointBean")
public class DPIEndPointBean {
    public final static String ID = "id";
    public final static String NAME = "name";
    public final static String DEPLOY_SITE_NAME = "deploySiteName";
    public final static String IDC_HOUSE_ID = "idcHouseId";
    public final static String PORT = "port";
    public final static String ENABLED = "enabled";
    public final static String IS_SERVER_CHANNEL_CONNECTED = "isServerChannelConnected";
    public final static String IS_CLIENT_CHANNEL_CONNECTED = "isClientChannelConnected";
    public final static String PROBE_TYPE = "probeType";
    public final static String MASTER_IP = "masterIp";
    public final static String SLAVE_IP = "slaveIp";
    public final static String DESCRIPTION = "description";
    public final static String IS_HEARTBEAT_OK = "isHeartbeatOk";
    
    @DatabaseField(columnName=ID, id=true)
    private int id;
    
    @DatabaseField(columnName=NAME)
    private String name;
    
    @DatabaseField(columnName=DEPLOY_SITE_NAME)
    private String deploySiteName;
    
    @DatabaseField(columnName=IDC_HOUSE_ID)
    private String idcHouseId;
    
    @DatabaseField(columnName=PORT)
    private int port;
    
    @DatabaseField(columnName=ENABLED)
    private boolean enabled;
    
    @DatabaseField(columnName=IS_SERVER_CHANNEL_CONNECTED)
    private boolean serverChannelConnected;
    
    @DatabaseField(columnName=IS_CLIENT_CHANNEL_CONNECTED)
    private boolean clientChannelConnected;
    
    @DatabaseField(columnName=PROBE_TYPE)
    private int probeType;
    
    @DatabaseField(columnName=MASTER_IP)
    private String masterIp;
    
    @DatabaseField(columnName=SLAVE_IP)
    private String slaveIp;
    
    @DatabaseField(columnName=DESCRIPTION)
    private String description;
    
    @DatabaseField(columnName=IS_HEARTBEAT_OK)
    private boolean heartbeatOk;

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDeploySiteName() {
        return deploySiteName;
    }

    public void setDeploySiteName(String deploySiteName) {
        this.deploySiteName = deploySiteName;
    }

    public String getIdcHouseId() {
        return idcHouseId;
    }

    public void setIdcHouseId(String idcHouseId) {
        this.idcHouseId = idcHouseId;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public boolean isServerChannelConnected() {
        return serverChannelConnected;
    }

    public void setServerChannelConnected(boolean serverChannelConnected) {
        this.serverChannelConnected = serverChannelConnected;
    }

    public boolean isClientChannelConnected() {
        return clientChannelConnected;
    }

    public void setClientChannelConnected(boolean clientChannelConnected) {
        this.clientChannelConnected = clientChannelConnected;
    }

    public int getProbeType() {
        return probeType;
    }

    public void setProbeType(int probeType) {
        this.probeType = probeType;
    }

    public String getMasterIp() {
        return masterIp;
    }

    public void setMasterIp(String masterIp) {
        this.masterIp = masterIp;
    }

    public String getSlaveIp() {
        return slaveIp;
    }

    public void setSlaveIp(String slaveIp) {
        this.slaveIp = slaveIp;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public boolean isHeartbeatOk() {
        return heartbeatOk;
    }

    public void setHeartbeatOk(boolean heartbeatOk) {
        this.heartbeatOk = heartbeatOk;
    }

    @Override
    public int hashCode() {
        return masterIp.hashCode() + id;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null || obj.getClass() != getClass()) {
            return false;
        }
        return id == ((DPIEndPointBean)obj).id;
    }
    
}
